package com.tuling.designpattern.iterator;

/**
 * @author 林瑞涛
 * @desc   测试类
 * @date 2021年08月04日 14:14
 */
public class Client {
    public static void main(String[] args) {
        Aggregate aggregate = new ConcreteAggregate();
        aggregate.add("小明");
        aggregate.add("小红");
        aggregate.add("小刚");
        Iterator iterator = aggregate.iterator();
        while (iterator.hasNext()){
            String next = (String) iterator.next();
            System.out.println(next);
        }
    }
}
